package cn.xu.liteflow.components;

import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import org.springframework.stereotype.Component;

/**
 * @Author xuguofei clark2021@qq.com || WX clark_2023
 * @Date 2024/3/5
 * @Desc TODO
 **/
@LiteflowComponent("a2")
@LiteflowCmpDefine
public class ACmp2{

    @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
    public void process(NodeComponent bindCmp) {
        //do your business
        System.out.println("a-------------------hell world");
        Order order = bindCmp.getContextBean(Order.class);
        System.out.println("order----->"+order);
        order.setAddr("上海市青浦区蟠龙天地");
    }

    @LiteflowMethod(LiteFlowMethodEnum.BEFORE_PROCESS)
    public void beforeAcmp(NodeComponent bindCmp){
        System.out.println("before A");
    }

    @LiteflowMethod(LiteFlowMethodEnum.AFTER_PROCESS)
    public void afterAcmp(NodeComponent bindCmp){
        System.out.println("after A");
    }

}
